//
//  downloadAPPViewController.m
//  AssistantCloud1
//
//  Created by YYKJ on 2017/4/15.
//  Copyright © 2017年 YYKJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

typedef NS_ENUM(NSInteger,AFNetworkErrorType) {
    // -1001 请求超时
    AFNetworkErrorType_TimedOut = NSURLErrorTimedOut,
    // -1002 不支持的URL
    AFNetworkErrorType_UnUrl = NSURLErrorUnsupportedURL,
    // -1009 断网
    AFNetworkErrorType_NoNetwork = NSURLErrorNotConnectedToInternet,
    // -1011 404错误
    AFNetworkErrorType_404Failed = NSURLErrorBadServerResponse,
    // 请求或返回不是json格式
    AFNetworkErrorType_3840Failed = 3840,
};

@interface BVHttpRequest : NSObject
/**
 *  get请求
 *
 *  @param URLString  基本的URL
 *  @param parameters 参数字典
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)getWithUrlString:(NSString *)URLString
 parameters:(id)parameters
    success:(void (^)(id responseObject))success
    failure:(void (^)(NSError *error))failure;

/**
 *  post请求
 *
 *  @param URLString  基本的URL
 *  @param parameters 参数字典
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)postWithUrlString:(NSString *)URLString
              parameters:(id)parameters
                 success:(void (^)(id responseObject))success
                 failure:(void (^)(NSError *error))failure;


/**
 *  单个头像上传
 *
 *  @param URLString  基本URL
 *  @param parameters 参数
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)uploadImageWithUrlString:(NSString *)URLString image:(UIImage *)image parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;


/**
 *  多个图片上传
 *
 *  @param UrlString  基本URL
 *  @param parameters 参数
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)uploadImageWithUrlString:(NSString *)UrlString imagedatas:(NSMutableArray *)imageDatas parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

@end
